{% extends "bootstrap/base.html" %}

{% block head %}
    <title>{% block page_title %}{% endblock page_title %}--任务管理系统</title>

    {% block metas %}
    {{ super() }}
    <link rel="shortcut icon" type="image/x-icon" href="{{ url_for('static',filename='favicon.ico') }}">
    {% endblock %}

    {% block styles %}
    {{ super() }}
    <!-- 加载自定义样式 -->
    {% endblock %}
{% endblock %}

{% block body %}
<!-- 导航 -->
{% block navbar %}
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container">
    <div class="navbar-header">
        <a class="navbar-brand" href="{{ url_for('main.index') }}">任务列表</a>
    </div>
    <div id="navbar" class="collapse navbar-collapse">
        <ul class="nav navbar-nav navbar-right">
            <li><a href="#">{{ current_user.username }}</a></li>
        {% if current_user.isAdmin() %}
            <li><a href="{{ url_for('main.addTask') }}">添加任务</a></li>
        {% endif %}
        {% if current_user.is_authenticated %}
            <li><a href="{{ url_for('main.changePassword') }}">修改密码</a></li>
            <li><a href="{{ url_for('main.logout') }}">Sing Out</a></li>
        {% endif %}
        </ul>
    </div><!--/.nav-collapse -->
    </div>
</nav>
{% endblock %}

<!-- flash 消息提示 start -->
<div>
{% for category,message in get_flashed_messages(with_categories=True) %}
    <div class="alert alert-{{ category }}">
        <button type="button" class="close" data-dismiss="alert">x</button>
    {{ message }}
    </div>
{% endfor %}
</div>
<!-- flash 消息提示 end -->


<!-- 主体内容 start -->
{% block content %}
    <div class="container" style="margin-top: 55px;">
        <!-- flash 消息提示 start -->
        {% for category,message in get_flashed_messages(with_categories=True) %}
            <div class="alert alert-{{ category }}">
                <button type="button" class="close" data-dismiss="alert">&times;</button>
            {{ message }}
            </div>
        {% endfor %}
        <!-- flash 消息提示 end -->

        <!-- 页面内容 start -->
        {% block page_content%}{% endblock %}
        <!-- 页面内容 end -->
    </div>  <!-- end container -->

    <!-- 页面脚注 start-->
    {% block footer%}{% endblock %}
    <!-- 页面脚注 end-->
    
{% endblock content %}
<!-- 主体内容 end -->


{% endblock %}

